<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<meta HTTP-EQUIV="EXPIRES" CONTENT="0">
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

   <script>
      $(document).ready(function() {
         $('.listingTbl tr:even').addClass("evenRow");
         $('.listingTbl tr:odd').addClass("oddRow");
      })
      
      function edit()
      {
         fnForward("company.shs", "editCompany");
      }

      function add() 
      {
         Form.companyId.value = '';
         fnForward("company.shs", "addCompany");
      }
   </script>
</head>
<body class="textInputNormal_12">

   <form name="companyForm" method="post">
      <input type="hidden" name="impl"/>
      <input type="hidden" name="companyId" value="${companyForm.companyId}"/>
      <script>
         var pgName = "custCtr";
         var Form = document.companyForm;
      </script>
      
      <!-- TODO: Need to provide a better implementation for the Back -->
      <input type="button" class="bttn" value=" Back " onclick="history.go(-1)"/>
      <input type="button" class="bttn" value="  Edit  " onclick="edit()" id="editBttn"/>
      <input type="button" class="bttn" value="  Add  " onclick="add()" id="addBttn"/>
      <br/><br/>
      <c:choose>
         <c:when test="${company != null}">
            <div style="margin-top: 10px;">
               <table width="45%" class="listingTbl">
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Company Name</span>
                     </td>
                     <td>
                        ${company.companyName}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Address Line 1</span>
                     </td>
                     <td>
                        ${company.address1}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Address Line 2</span>
                     </td>
                     <td>
                        ${company.address2}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Address Line 3</span>
                     </td>
                     <td>
                        ${company.address3}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">City</span>
                     </td>
                     <td>
                        ${company.city}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">State</span>
                     </td>
                     <td>
                        ${company.state}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Postal Code</span>
                     </td>
                     <td>
                        ${company.postalCode}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Company Phone</span>
                     </td>
                     <td>
                        ${company.companyPhone}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Contact Name</span>
                     </td>
                     <td>
                        ${company.contactName}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Contact Phone</span>
                     </td>
                     <td>
                        ${company.contactPhone}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Contact Mobile</span>
                     </td>
                     <td>
                        ${company.contactMobile}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Contact E-mail</span>
                     </td>
                     <td>
                        ${company.contactEMail}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Monthly Fees</span>
                     </td>
                     <td>
                        ${company.monthlyFees}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Labour Cost</span>
                     </td>
                     <td>
                        ${company.labourCost}
                     </td>
                  </tr>
                  <tr>
                     <td width="40%">
                        <span class="textSmallCaps">Comments</span>
                     </td>
                     <td>
                        ${company.comments}
                     </td>
                  </tr>
               </table>
            </div>
         </c:when>
         <c:otherwise>
            <div class="errDiv">
               No data available for the selected waste type.
               <script>
                  $("#editBttn").filter(function(){ this.style.display = 'none'; });
                  $("#addBttn").filter(function(){ this.style.display = 'none'; });
               </script>
            </div>
         </c:otherwise>
      </c:choose>
      
   
   </form>

</body>
</html>